Effective Typescript: 62 Specific Ways to Improve Your TypeScript

Effective Typescript: 62 Specific Ways to Improve Your TypeScript

  • Downloads:1156
  • Type:Epub+TxT+PDF+Mobi
  • Create Date:2021-10-15 08:53:26
  • Update Date:2025-09-06
  • Status:finish
  • Author:Dan Vanderkam
  • ISBN:1492053740
  • Environment:PC/Android/iPhone/iPad/Kindle

Summary

TypeScript is a typed superset of JavaScript with the potential to solve many of the headaches for which JavaScript is famous。 But TypeScript has a learning curve of its own, and understanding how to use it effectively can take time。 This book guides you through 62 specific ways to improve your use of TypeScript。

Author Dan Vanderkam, a principal software engineer at Sidewalk Labs, shows you how to apply these ideas, following the format popularized by Effective C++ and Effective Java (both from Addison-Wesley)。 You’ll advance from a beginning or intermediate user familiar with the basics to an advanced user who knows how to use the language well。

Effective TypeScript is divided into eight chapters:

Getting to Know TypeScript
TypeScript’s Type System
Type Inference
Type Design
Working with any
Types Declarations and @types
Writing and Running Your Code
Migrating to TypeScript

Download

Reviews

Diego Pacheco

It's a good book。 Remind me a lot of effective Java。 I like a lot the part where the author covers the issues and limitations with TypeScript。 The book does not cover all Type utilities in Typescript, it covers some like Unions, type but many as left over。 It's a good book anyways。 It's a good book。 Remind me a lot of effective Java。 I like a lot the part where the author covers the issues and limitations with TypeScript。 The book does not cover all Type utilities in Typescript, it covers some like Unions, type but many as left over。 It's a good book anyways。 。。。more

Alex

The book is great at identifying some good practices and some traps。 I am still finding my peace with Typescript, but I can see the type system goodness as well。I came to JavaScript from C/C++/Go background so it was a massive mindset shift on its own。 The idea of type "safe" JavaScript appealed to me very much, however in practice it turned out to be very different from the "normal" type safe languages and most of the type safeness are just pinky promises to stick to the contract - the promises The book is great at identifying some good practices and some traps。 I am still finding my peace with Typescript, but I can see the type system goodness as well。I came to JavaScript from C/C++/Go background so it was a massive mindset shift on its own。 The idea of type "safe" JavaScript appealed to me very much, however in practice it turned out to be very different from the "normal" type safe languages and most of the type safeness are just pinky promises to stick to the contract - the promises that can be easily broken in runtime。 :)I'm definitely keeping the book on my desk as a reference going forward (along with Programming Typescript book which is also great)。 。。。more

Kevin Garner

I've used TypeScript in a variety of settings since it came out。 I've leveraged the features that are now considered historical curiosities (Enums, namespaces, triple-slash references。。。 I'm looking at you 👀)。 I've migrated a legacy WebForms / jQuery application to TypeScript 😱。 I've maintained multiple Angular applications driven entirely on TypeScript。 I've written source generators that create TypeScript contracts from C# models。 I've made my own hobbyist Vue and React applications with TypeS I've used TypeScript in a variety of settings since it came out。 I've leveraged the features that are now considered historical curiosities (Enums, namespaces, triple-slash references。。。 I'm looking at you 👀)。 I've migrated a legacy WebForms / jQuery application to TypeScript 😱。 I've maintained multiple Angular applications driven entirely on TypeScript。 I've written source generators that create TypeScript contracts from C# models。 I've made my own hobbyist Vue and React applications with TypeScript。 I've even written some Deno applications here and there。 Despite all that, I learned so much about TypeScript by reading this book, things that I wish I knew before! This book is an easy 5 stars。 As you read it, you develop what the author calls mental models for understanding and using TypeScript。 The book contains excellent advice and a full rundown of TypeScript's type system。 People coming from OO languages like C# will be able to really disambiguate TypeScript's type system from their own typed language。 People coming from a purely JavaScript background will be given what I think is the gold standard of instruction on how to use TypeScript。 And, you can test-drive all of the code samples on a site like https://www。typescriptlang。org/play。 I read it digitally, and I will be getting a hard copy of this book to reference and reread in the future。 If you want to learn *effective TypeScript*, check out this book。 。。。more

Michael Caveney

It can be hard to figure out exactly what goes where when writing TypeScript, but this book is an opinionated guide that backs up its reasoning and greatly reduces decision fatigue on how to employ it in applications。 This is essential reading for any developer using TypeScript!

Jesus

Interesante libro con muchas cosas que no conocía de Typescript。 Muchas veces empezamos a tocar tecnologías que no conocemos y vamos aprendiendo sobre la marcha (haciendo mal las cosas) y este libro ha un vistazo rápido pero profundo de lo que Typescript tiene a tu disposición

Theofanis Despoudis

A nice book for refreshing your knowledge in Typescript。 It's not exceptional but it's does it's job。 A nice book for refreshing your knowledge in Typescript。 It's not exceptional but it's does it's job。 。。。more

Rafael Gonzaga

Most of part of the book is useful information, however, this information is already well known by developers who work with typescript。

Tatiana Shepeleva

A handbook with examples to understand the twists of TS

Trung

Finally, finish this fantastic book after a few months。 I think this kind of book need times to digest and apply to my day-to-day task。 An excellent resource for TypeScript!

Rob

As a long-time JavaScript developer, but as someone relatively new to TypeScript, this book was the right thing at the right time for me。 I didn’t need an introductory-level book — TS being a superset of JS, after all, and syntax being something you can muddle through — but what I DID need was something that spoke to what was (1) idiomatic and (2) could shine a light on some of TS’s… idiosyncrasies。This book helped me better frame my thinking around the so-called “type space” vs。 the runtime cod As a long-time JavaScript developer, but as someone relatively new to TypeScript, this book was the right thing at the right time for me。 I didn’t need an introductory-level book — TS being a superset of JS, after all, and syntax being something you can muddle through — but what I DID need was something that spoke to what was (1) idiomatic and (2) could shine a light on some of TS’s… idiosyncrasies。This book helped me better frame my thinking around the so-called “type space” vs。 the runtime code, as well as how to best consider TS’s structural typing as a good fit for JS’s notoriously loose types。There are still some places where I scribbled “looks like more trouble than it’s worth” in the margins (but not too many) and I STILL have some work to do to get fluent in generics… BUT I would recommend this to anyone that has either (1) been working in TypeScript for 6+ months, and/or (2) who is coming I to TypeScript with a proficiency in JavaScript (looking at you, Dreyfus skill model)。 。。。more

TK

I come from a place that I'm pretty familiar with TypeScript before reading this book。 But it was a great experience learning more about this language in depth。The first chapter was awesome in a way that the book shows more about language than simply about the syntax。 It talks about the relationship between JavaScript and TypeScript, how does the structural typing works, the differences between the type and value spaces。The second chapter talks more about how TypeScript can improve the developer I come from a place that I'm pretty familiar with TypeScript before reading this book。 But it was a great experience learning more about this language in depth。The first chapter was awesome in a way that the book shows more about language than simply about the syntax。 It talks about the relationship between JavaScript and TypeScript, how does the structural typing works, the differences between the type and value spaces。The second chapter talks more about how TypeScript can improve the developer experience together with a code editor。The following chapters are about how we can use types to be more effective。I used this book as a reference to write my long-format essay about A Mental Model to think in TypeScript (https://leandrotk。github。io/tk/2020/0。。。)。I really recommend this book for beginners and experienced developers。 。。。more

Lukasz

I use Typescript for few years already and I find this book really great if you have some experience with TS。It will be rather poor choice for super beginners (however might be ok if you migrate from C# and you learn it in parallel with JS), but TS users can find a lot of understanding of TS best practicesIt has nice structure of "pro tips" - you can skip part which is obvious to you。Also it has a chapter how to migrate legacy codebase to TS。It definitely helped me and I used some of the protips I use Typescript for few years already and I find this book really great if you have some experience with TS。It will be rather poor choice for super beginners (however might be ok if you migrate from C# and you learn it in parallel with JS), but TS users can find a lot of understanding of TS best practicesIt has nice structure of "pro tips" - you can skip part which is obvious to you。Also it has a chapter how to migrate legacy codebase to TS。It definitely helped me and I used some of the protips literally next day。 。。。more

John

The author posted about this book on reddit, and it looked good so I bought a copy straight away。 Nice job, Dan!The book is mostly very good。 I've been using TypeScript for 3 years now, so it mostly wasn't so new to me, but it did clarify a lot of the things I knew。 In particular, as I haven't read a whole lot of TypeScript code, the convention of using discriminated unions was new to me, and I hadn't really understood how well TypeScript supports it。I did think the description of transitive dep The author posted about this book on reddit, and it looked good so I bought a copy straight away。 Nice job, Dan!The book is mostly very good。 I've been using TypeScript for 3 years now, so it mostly wasn't so new to me, but it did clarify a lot of the things I knew。 In particular, as I haven't read a whole lot of TypeScript code, the convention of using discriminated unions was new to me, and I hadn't really understood how well TypeScript supports it。I did think the description of transitive dependencies was a bit of a shambles (I can't find the section to say which it was), but I learnt about transitivity in maths classes, so any non-mathematical description of it is going to make me twitch。。。 maybe it's just me。I'm a little torn between giving 3 and 4 stars, as I felt I didn't learn a whole lot, and large sections kinda stretched the concept of "specific ways"。 On the other hand, I did make improvements to some of the older TypeScript in my Angular projects, and I did get a bit overexcited writing types in a new project, so I went with the 4 stars。 It's possible that a younger programmer than me, who's interested in migrating to TypeScript from JavaScript, could get very excited indeed about this book。 。。。more

Mary

We read the introduction and that probably was our limit。 But I am fond of the author and very proud of his work and thus am rating this book five stars。

Thomas

Great book! I thought I knew a lot about TypeScript already, but this book has some tips I did not know before and not readily found on the internet。

Stefan Kanev

This book is a collection of 62 nuggets of information about TypeScript (advices, suggestions, clarifications, best practices, etc。)。 It’s targeted at someone who already knows TypeScript and wants to learn more。I absolutely love it。 It explained a couple of things I didn’t understand and generally has good advice。It’s a great second TypeScript book。

Glen

I really enjoyed the format。 The short sections provided illustrating examples and just enough detail。 Every time I put the book down, I felt like I had learned something I could apply immediately。

Matěj

The book structured into several areas, each presents you with a series of specific tips (the autor has listed the areas and tips on his GitHub)。 It assumes reasonable knowledge of both modern JS and TS。 It definitely isn't a comprehensive intro to TS。It dedicates about 1-4 pages to each tip, including motivation and detailed explanation with code samples。 The writing is easy to understand and avoids any detours/asides and filler; all the code samples are clear and compact (none go past half-pag The book structured into several areas, each presents you with a series of specific tips (the autor has listed the areas and tips on his GitHub)。 It assumes reasonable knowledge of both modern JS and TS。 It definitely isn't a comprehensive intro to TS。It dedicates about 1-4 pages to each tip, including motivation and detailed explanation with code samples。 The writing is easy to understand and avoids any detours/asides and filler; all the code samples are clear and compact (none go past half-page length, most are ony a few lines of code)。 Each tip is clearly labeled so you can easily skip those that don't interest you。 There are abundant cross-references where appropriate。The tips are generally very environment agnostic - none of them deal with specific libraries/frameworks and only about 2 of them are specific to browser; none are specific to Node。 Several of them are specific to library authoring though。 Some of the tips seemed a bit obvious (especially early on, eg。 "don't use Any") but many of them taught me a lot。 I couldn't find any factual errors, however one or two of the tips left me unconvinced and perhaps would warrant even longer elaboration (especially the "use readonly" tip)。The book hit me in exactly the right spot。 I'm an experienced developer and I've worked with JS on and off for many years, but my structured TS education is limited to the official tutorial。 I was able to figure out most of it along the way (TS is intuitive if you have good JS knowledge and realize how it works, Google and SO helped a lot too), but this approach also left me with a lot of gaps in my knowledge, many of which I don't even realize I have。 This book excels at plugging such gaps。Now I have to go and refactor some of my code in the light of what I've learned。 。。。more